//#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=64;

int main() {
  freopen("code.in", "r", stdin);
  freopen("code.out", "w", stdout);
  int n;
  unsigned long long k;
  scanf("%d %llu", &n, &k);

  static int ans[maxn+1];
  for (int i=1; i<=n; i++) {
    unsigned long long t=(1ULL<<(n-i))-1;
    if (k<=t) {
      ans[i] = 0;
    } else {
      ans[i] = 1;
      if (n-i+1==64) {
	k = (-1ULL)-k;
      } else {
	k = (1ULL<<(n-i+1))-1-k;
      }
    }
  }

  for (int i=1; i<=n; i++) {
    printf("%d", ans[i]);
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
